﻿using System;
using System.Diagnostics;
using System.Net;


namespace Silverlight.Weblog.Shared.Common.Logging
{
    public static class Logger
    {
        [Conditional("DEBUG")]
        public static void Log(string message, params object[] args)
        {
            Debug.WriteLine(message, args);
        }

        [Conditional("DEBUG")]
        public static void Log(Exception ex)
        {
            Log("Exception {0} {1}: {2}", ex.GetType().Name, (ex.InnerException != null ? "has inner exception" : "with no inner exception"), ex.Message);
            Log(ex.StackTrace);
            if (ex.InnerException != null)
                Log(ex.InnerException);
        }
    }
}
